package com.org.web.api.mobile;


import com.org.platform.model.ResultModel;
import com.org.platform.utils.CommonUtil;
import java.util.Map;
import org.apache.commons.codec.binary.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = {"/mobile/user"})
public class MobileUserController {

    @PostMapping(value = {"/login"})
    public ResultModel userLogin(@RequestBody Map<String,Object> params) {
        String username = CommonUtil.getMapString(params,"username");
        String password = CommonUtil.getMapString(params,"password");
        if(StringUtils.equals(username,"devg")&& StringUtils.equals(password,"123")){
            return ResultModel.newSuccess();
        }
        return ResultModel.newFail("用户密码不正确");
    }

}
